package com.tledu.production.service.plan.impl;

import com.tledu.production.mapper.plan.Customer.CustomerMapper;
import com.tledu.production.mapper.plan.Job.JobMapper;
import com.tledu.production.mapper.plan.Order.OrderMapper;
import com.tledu.production.mapper.plan.Product.ProductMapper;
import com.tledu.production.model.plan.CustomerManagement;
import com.tledu.production.model.plan.JobManagement;
import com.tledu.production.model.plan.OrderManagement;
import com.tledu.production.model.plan.ProductManagement;
import com.tledu.production.service.plan.PlanService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
@AllArgsConstructor
public class PlanServiceImpl implements PlanService {
    private final CustomerMapper customerMapper;
    private final JobMapper jobMapper;
    private final OrderMapper orderMapper;
    private final ProductMapper productMapper;



    @Override
    public List<CustomerManagement> getAllC() {
        return customerMapper.getAllC();
    }

    @Override
    public List<JobManagement> getAllJ() {
        return jobMapper.getAllJ();    }

    @Override
    public List<OrderManagement> getAllO() {
        return orderMapper.getAllO();    }

    @Override
    public List<ProductManagement> getAllP() {
        return productMapper.getAllP();    }
//添加



    @Override
    public int insertP(ProductManagement productManagement) {
        return productMapper.insertP(productManagement);
    }

    @Override
    public int insertC(CustomerManagement customerManagement) {
        return customerMapper.insertC(customerManagement);
    }

    @Override
    public int insertJ(JobManagement jobManagement) {
        return jobMapper.insertJ(jobManagement);
    }

    @Override
    public int insertO(OrderManagement orderManagement) {
        return orderMapper.insertO(orderManagement);
    }



    //删除
    @Override
    public int deleteP(String id) {
        return productMapper.deleteP(id);
    }

    @Override
    public int deleteO(String id) {
        return orderMapper.deleteO(id);
    }


    //编辑
    @Override
    public int updateP(ProductManagement productManagement) {
        return productMapper.updateP(productManagement);
    }

    @Override
    public ProductManagement editP(String id) {
        return productMapper.editP(id);
    }


    @Override
    public int updateC(CustomerManagement customerManagement) {
        return customerMapper.updateC(customerManagement);
    }

    @Override
    public CustomerManagement editC(Integer id) {
        return customerMapper.editC(id);
    }

    @Override
    public int updateJ(JobManagement jobManagement) {
        return jobMapper.updateJ(jobManagement);
    }

    @Override
    public JobManagement selectJ(Integer id) {
        return jobMapper.selectJ(id);
    }



    //c_order
    @Override
    public OrderManagement selectO(Integer id) {
        return orderMapper.selectO(id);
    }
    @Override
    public int updateO(OrderManagement orderManagement) {
        return orderMapper.updateO(orderManagement);
    }

    //****************************查找**************************
    @Override
    public List<CustomerManagement> search(String condition, String conditionName) {
        return customerMapper.search(condition, conditionName);
    }

    @Override
    public List<OrderManagement> searchO(String type, String searchText) {
        return  orderMapper.search(type, searchText);
    }
}
